﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="allProfiles.aspx.vb" Inherits="CW1.allProfiles" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="DinerId" 
        DataSourceID="SqlDataSource1" GroupItemCount="4">
        <AlternatingItemTemplate>
            <td runat="server" style="background-color: #99FFCC;color: #9900FF;">
                <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' Font-Size='Large' /> 
                <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' Font-Size='Large' />
                <br /><br />Portrait:<br />
                <img src="<%# Eval("Portrait") %>" height="84px" width="125px"/>
                <br />Date Of Birth:
                <asp:Label ID="DateOfBirthLabel" runat="server" 
                    Text='<%# getDate(Eval("DateOfBirth")) %>' Font-Size='Large'/>
                <br />Registration Date:
                <asp:Label ID="RegistrationDateLabel" runat="server" 
                    Text='<%# getDate(Eval("RegistrationDate")) %>' Font-Size='Large'/>
                <br />Gender:
                <asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' Font-Size='Large' />
                <br />
                <br />Home Page:
                <a href="UserHomePages/HomePage.aspx?UserName=<%# Eval("DinerID") %>">GO</a>
                <br />
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="background-color: #FFCC66;color: #000080;">
                DinerId:
                <asp:Label ID="DinerIdLabel1" runat="server" Text='<%# Eval("DinerId") %>' />
                <br />FirstName:
                <asp:TextBox ID="FirstNameTextBox" runat="server" 
                    Text='<%# Bind("FirstName") %>' />
                <br />LastName:
                <asp:TextBox ID="LastNameTextBox" runat="server" 
                    Text='<%# Bind("LastName") %>' />
                <br />Portrait:
                <asp:TextBox ID="PortraitTextBox" runat="server" 
                    Text='<%# Bind("Portrait") %>' />
                <br />DateOfBirth:
                <asp:TextBox ID="DateOfBirthTextBox" runat="server" 
                    Text='<%# Bind("DateOfBirth") %>' />
                <br />RegistrationDate:
                <asp:TextBox ID="RegistrationDateTextBox" runat="server" 
                    Text='<%# Bind("RegistrationDate") %>' />
                <br />Gender:
                <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" 
                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>
                        No returned data</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                DinerId:
                <asp:TextBox ID="DinerIdTextBox" runat="server" Text='<%# Bind("DinerId") %>' />
                <br />FirstName:
                <asp:TextBox ID="FirstNameTextBox" runat="server" 
                    Text='<%# Bind("FirstName") %>' />
                <br />LastName:
                <asp:TextBox ID="LastNameTextBox" runat="server" 
                    Text='<%# Bind("LastName") %>' />
                <br />Portrait:
                <asp:TextBox ID="PortraitTextBox" runat="server" 
                    Text='<%# Bind("Portrait") %>' />
                <br />DateOfBirth:
                <asp:TextBox ID="DateOfBirthTextBox" runat="server" 
                    Text='<%# Bind("DateOfBirth") %>' />
                <br />RegistrationDate:
                <asp:TextBox ID="RegistrationDateTextBox" runat="server" 
                    Text='<%# Bind("RegistrationDate") %>' />
                <br />Gender:
                <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td id="Td1" runat="server" style="background-color: #FAFAD2;color: #284775;">
                <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' Font-Size='Large' /> 
                <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' Font-Size='Large' />
                <br /><br />Portrait:<br />
                <img src="<%# Eval("Portrait") %>" height="84px" width="125px"/>
                <br />Date Of Birth:
                <asp:Label ID="DateOfBirthLabel" runat="server" 
                    Text='<%# getDate(Eval("DateOfBirth")) %>' Font-Size='Large'/>
                <br />Registration Date:
                <asp:Label ID="RegistrationDateLabel" runat="server" 
                    Text='<%# getDate(Eval("RegistrationDate")) %>' Font-Size='Large'/>
                <br />Gender:
                <asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' Font-Size='Large' />
                <br />
                <br />Home Page:
                <a href="UserHomePages/HomePage.aspx?UserName=<%# Eval("DinerID") %>">GO</a>
                <br />
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="1" 
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" 
                        style="text-align: center;background-color: #FFCC66;font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333;">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" 
                style="background-color: #FFCC66;font-weight: bold;color: #000080;">
                DinerId:
                <asp:Label ID="DinerIdLabel" runat="server" Text='<%# Eval("DinerId") %>' />
                <br />FirstName:
                <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' />
                <br />LastName:
                <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' />
                <br />Portrait:
                <asp:Label ID="PortraitLabel" runat="server" Text='<%# Eval("Portrait") %>' />
                <br />DateOfBirth:
                <asp:Label ID="DateOfBirthLabel" runat="server" 
                    Text='<%# Eval("DateOfBirth") %>' />
                <br />RegistrationDate:
                <asp:Label ID="RegistrationDateLabel" runat="server" 
                    Text='<%# Eval("RegistrationDate") %>' />
                <br />Gender:
                <asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' />            
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WarriorConnection %>" 
        ProviderName="<%$ ConnectionStrings:WarriorConnection.ProviderName %>" 
        SelectCommand="SELECT [DinerId], [FirstName], [LastName], [Portrait], [DateOfBirth], [RegistrationDate], [Gender] FROM [UserProfile]">
    </asp:SqlDataSource>
</asp:Content>
